<!--
 * @Author: your name
 * @Date: 2022-03-11 11:41:10
 * @LastEditTime: 2022-03-22 16:23:59
 * @LastEditors: Please set LastEditors
 * @FilePath: \VUE\app\src\App.vue
-->
<template>
  <div id="app">
    <Header />
    <!--路由组件出口的地方-->
    <router-view></router-view>
    <Footer v-show="$route.meta.show" />
  </div>
</template>

<script>
import Header from "./components/Header";
import Footer from "./components/Footer";
export default {
  name: "App",
  components: {
    Header,
    Footer,
  },
  mounted() {
    //通知vuex发请求，获取数据，存储于仓库中,App组件只挂载一次，减少服务器压力
    this.$store.dispatch("categoryList");
    // if(localStorage.getItem('TOKEN')){
    // this.$router.push('/home')
    // }else {
    // this.$router.push('/login')
    // }
  },
};
</script>

<style lang='less'>
</style>
